home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_bab_bombfloor.cog < prev    next >
Text File  |  1999-11-15  |  6KB  |  169 lines

  1. # Jones 3D Cog Script
  2. #
  3. # BAB_Bombfloor.cog
  4. # This cog is based on the brilliant groundbreaking cog work pioneered by Reed Derleth
  5. #
  6. # [SXC]
  7. #
  8. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13.     message     startup
  14.     message     damaged
  15.     message     crossed
  16.     message     entered
  17.     
  18.     template    debris0=stoneshrapa_nc          local
  19.     template    debris1=stoneshrapam_nc         local
  20.     template    debris2=stoneshrapas_nc         local
  21.     template    debris3=stoneshrapb_nc          local
  22.     template    debris4=stoneshrapbs_nc         local
  23.     
  24.     template    staticfrag0=stnshrpa            local
  25.     template    staticfrag1=stnshrpb            local
  26.     template    staticfrag2=stnshrpc            local
  27.     
  28.     template    bigboom=+baz_spr_exp_blast      local
  29.     template    smoke=+baz_spr_exp_smoke        local
  30.     template    doorboom=+gen_exp_metal         local
  31.     
  32.  
  33.     thing       droppos
  34.     thing       smokepos0                  
  35.     thing       smokepos1
  36.     thing       smokepos2
  37.     thing       boompos
  38.     
  39.     thing       fragpos0
  40.     thing       fragpos1
  41.     thing       fragpos2
  42.     thing       fragpos3
  43.     thing       fragpos4
  44.     thing       fragpos5
  45.     thing       fragpos6
  46.     
  47.     thing       fallcam0
  48.     thing       metaldoor
  49.     thing       metaldoorpos
  50.               
  51.     surface     topface                         mask=0x40
  52.     surface     fallface
  53.     sector      archsector
  54.     sector      topsector
  55.     sector      watersector                     linkid=5
  56.     sector      watersector1                    linkid=5
  57.     sector      watersector2                    linkid=5
  58.                                                 
  59.     int         count                           local
  60.     int         fragment                        local
  61.     int         bdone=0                         local
  62.     int         croscheck                       local
  63.     thing       player                          local
  64.     
  65.     sound       indyfall=mus_flourish.wav       local
  66.  
  67. end
  68.  
  69. code
  70.  
  71. # ========================================================================================
  72. startup:
  73.     player = GetLocalPlayerThing();
  74.     SetFaceGeoMode(topface, 4);         //always draw
  75.     ClearAdjoinFlags(topface, 2);       //no nove
  76.     SetSectorAdjoins(topsector, 0);     //adjoins are off
  77.    
  78. return;
  79.  
  80. #----------------------------------------------------------------------------------------
  81. damaged:
  82.  
  83.     if ((GetSenderRef() == topface) && (GetSectorPlayerCount(archsector) == 0) && (bdone == 0))
  84.     {
  85.         bdone=1;
  86.         sleep(0.25);
  87.         for(count=0; count<2; count=count+1)                                                                        
  88.         {                                                                                                    
  89.             fragment = CreateThing(debris0[RandBetween(0, 4)], boompos);                                 
  90.             SetThingVel(fragment, VectorScale(VectorAdd(RandVec(), '-0.5 -0.1 0.0'), 2));
  91.             SetThingRotVel(fragment, VectorScale(VectorAdd(RandVec(), '0.0 0.0 0.0'), 900.0));                    
  92.         }
  93.         CreateThing(staticfrag0, fragpos0);
  94.         CreateThing(staticfrag1, fragpos1);
  95.         CreateThing(staticfrag2, fragpos2);
  96.         CreateThing(staticfrag0, fragpos3);                
  97.         CreateThing(staticfrag1, fragpos4);
  98.         //CreateThing(staticfrag2, fragpos5);
  99.         //CreateThing(staticfrag0, fragpos6);
  100.         sleep(0.1);                
  101.         //print("Getting Damaged");
  102.         SetFaceGeoMode(topface, 0);         //no draw
  103.         SetAdjoinFlags(topface, 2);         //move
  104.         SetSectorAdjoins(topsector, 1);     //render past adjoin
  105.     }
  106.     
  107.     if ((GetSenderRef() == topface) &&
  108.         (GetSectorPlayerCount(archsector) == 1) && 
  109.         (bdone == 0) &&
  110.         (GetCurFrame(metaldoor) == 0))
  111.     {
  112.         bdone=1;
  113.         sleep(0.25);
  114.         for(count=0; count<2; count=count+1)                                                                        
  115.         {                                                                                                    
  116.             fragment = CreateThing(debris0[RandBetween(0, 4)], boompos);                                 
  117.             SetThingVel(fragment, VectorScale(VectorAdd(RandVec(), '-0.5 -0.1 0.0'), 2));
  118.             SetThingRotVel(fragment, VectorScale(VectorAdd(RandVec(), '0.0 0.0 0.0'), 900.0));                    
  119.         }
  120.         CreateThing(staticfrag0, fragpos0);
  121.         CreateThing(staticfrag1, fragpos1);
  122.         CreateThing(staticfrag2, fragpos2);
  123.         CreateThing(staticfrag0, fragpos3);                
  124.         CreateThing(staticfrag1, fragpos4);
  125.         
  126.         CreateThing(doorboom, metaldoorpos);
  127.         sleep(0.1);                
  128.         //print("Getting Damaged");
  129.         SetFaceGeoMode(topface, 0);         //no draw
  130.         SetAdjoinFlags(topface, 2);         //move
  131.         SetSectorAdjoins(topsector, 1);     //render past adjoin
  132.     }
  133.     
  134. return;
  135.  
  136. #---------------------------------------------------------------------------------------- 
  137. crossed:
  138.  
  139.     if ((GetSenderRef() == fallface) && (GetSourceRef() == player) && (croscheck == 0))       
  140.     {
  141.         croscheck = 1;
  142.         StartCutscene(0);
  143.         SetActorFlags(player, 0x200000);
  144.         SetCameraFocus(2, fallcam0);
  145.         StopThing(player);
  146.         TeleportThing(player, droppos);
  147.         ApplyForce(player, '0 0 -1');
  148.         SetCameraSecondaryFocus(2, player);
  149.         SetCurrentCamera(2);
  150.         PlaySoundLocal(indyfall, 1, 0, 0, 0);
  151.     }
  152.     
  153. return;
  154.     
  155. #----------------------------------------------------------------------------------------
  156. entered:
  157.  
  158.     if ((GetSenderID() == 5) && (GetSourceRef() == player))        
  159.     {
  160.         Sleep(1);
  161.         SetCurrentCamera(1);
  162.         ClearActorFlags(player, 0x200000);
  163.         EndCutscene();
  164.     }
  165.     
  166. return;
  167.     
  168. #----------------------------------------------------------------------------------------        
  169. end